﻿/*文件注释
 * ===============================================================================
 * 说明：
 * 作者：曾永佑
 * 版本：V1.0
 * 创建日期：2013-03-03
 * 完成日期： 
 * 修改纪录：  
 * ===============================================================================
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SRF.Security.Principal
{
    /// <summary>
    /// 用户
    /// </summary>
    public class User : IUser
    {
        System.Security.Principal.IIdentity _identity;

        public string Id { get; set; }
        public string LoginId { get; set; }
        public string UserName { get; set; }
        [System.Web.Script.Serialization.ScriptIgnore]
        public string Password { get; set; }

        [System.Web.Script.Serialization.ScriptIgnore]
        public System.Security.Principal.IIdentity Identity
        {
            get
            {
                if (_identity == null)
                {
                    _identity = new System.Security.Principal.GenericIdentity(LoginId);
                }
                return _identity;
            }
            set
            {
                _identity = value;
            }
        }

        public bool IsInRole(string role)
        {
            throw new NotImplementedException();
        }
    }
}